package cn.imvc.util;

import com.github.sd4324530.fastweixin.api.config.ApiConfig;

public class Wechat {
	
	private String appId;
	private String appSecret;
	private String wechatToken;
	
	private ApiConfig jsapiconfig;
	private ApiConfig apiconfig;
	
	public String getAppId() {
		return appId;
	}

	public void setAppId(String appId) {
		this.appId = appId;
	}

	public String getAppSecret() {
		return appSecret;
	}

	public void setAppSecret(String appSecret) {
		this.appSecret = appSecret;
	}

	public String getWechatToken() {
		return wechatToken;
	}

	public void setWechatToken(String wechatToken) {
		this.wechatToken = wechatToken;
	}

	public ApiConfig getJsapiconfig() {
		return jsapiconfig;
	}

	public void setJsapiconfig(ApiConfig jsapiconfig) {
		this.jsapiconfig = jsapiconfig;
	}

	public ApiConfig getApiconfig() {
		return apiconfig;
	}

	public void setApiconfig(ApiConfig apiconfig) {
		this.apiconfig = apiconfig;
	}

	public ApiConfig getApiConfig() {

		if (apiconfig == null) {
			apiconfig = new ApiConfig(this.getAppId(), this.getAppSecret());

		}
		return apiconfig;
	}

	public ApiConfig getJsApiConfig() {
		if (jsapiconfig == null) {
			jsapiconfig = new ApiConfig(this.getAppId(), this.getAppSecret(), true);
		}
		return jsapiconfig;
	}

}
